package com.hl.shifangzhiyu.service.Impl;

import com.hl.shifangzhiyu.pojo.Consultant1s;
import com.hl.shifangzhiyu.mapper.Consultant1sMapper;
import com.hl.shifangzhiyu.service.Consultant1sService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
@Service
public class Consultant1sServiceImpl implements Consultant1sService {

    @Autowired
    private Consultant1sMapper consultant1sMapper;
    @Override


    public List<Consultant1s> listAll() {
        return consultant1sMapper.listAll();
    }


    @Override
    public boolean deleteConsultant(Long id) {
        if (id == null) {
            return false;
        }
        int result = consultant1sMapper.deleteConsultantById(id);
        return result > 0;
    }

    @Override
    public boolean addConsultant(Consultant1s consultant1) {
        if (consultant1 == null) {
            return false;
        }
        int result = consultant1sMapper.insertConsultant(consultant1);
        return result > 0;
    }
}
